package com.whq.knowverywell.util;

import android.content.Context;
import android.os.PowerManager;

/**
 * 跟屏幕相关的工具类
 * @author wanghuaiqiang
 *
 */
public class ScreenUtil {
	private static final String TAG = "ScreenUtil";
	
	/**
	 * 检查屏幕是否打开
	 * @param context
	 * @return 打开返回true，否则返回false
	 */
	public static boolean chkScreenIsOn(Context context) {
		try {
			PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
			return pm.isScreenOn();
		} catch (Exception e) {
			LogUtil.e(TAG, "判断屏幕是否打开出错：", e);
		}
		return false;
	}
}
